package com.duan.canal.listener;

import com.alibaba.fastjson.JSONObject;
import com.duan.canal.config.RabbitMqConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class RabbitMqListener {
//    @RabbitListener(queues = RabbitMqConfig.RABBIT_QUEUE)
//    public void message(Message message) {
//        Object o = JSONObject.parse(message.getBody());
//        System.out.println("消费者1");
//        System.out.println(o);
//    }
//
//    @RabbitListener(queues = RabbitMqConfig.RABBIT_QUEUE1)
//    public void message1(Message message) {
//        Object o = JSONObject.parse(message.getBody());
//        System.out.println("消费者2");
//        System.out.println(o);
//    }
}
